package com.naiterui.ehp.bs.recommend.util;


public class Constants {

    /**
     * CRM推荐审核配置Redis key：<code>CRM_RECOM_SETTING</code>
     */
    public static final String CRM_RECOM_SETTING = "crm_recom_setting";

    /**
     * 诊疗记录来源系统处方
     */
    public static final int PRESCRIPTION_SYS = 2;

    public static final String ODC_REQUEST_PRESCRIPTION_SUCCESS_CODE = "00000";

    public static final int CRM_RESPONSE_SUCCESS = 200;

    /**
     * 医生签名底版_小版
     */
    public static final String SIGNATURE_CANVAS_IN_BASE64_SMALL =
            "iVBORw0KGgoAAAANSUhEUgAAAYIAAAB8CAYAAABkFbdUAAABo0lEQVR42u3VoREAMAgEQZpGpebUEFSa4Hdn3iAxV" +
                    "/f0MzOz3JUnmJkJgUeYmQmBmZkJwT8AsJoQAAiBEAAIgRAACIEQAAiBEAAIgR"
            + "AACIEQAAiBEAAIgRAACIEQAAiBEAAIgRcBCAEAQgCAEAAgBAAIAQBCAIAQACAEAAgBAEIAgBAAIAQACAEAQgCAEAAgBAAIAQBCAIAQACAEAAgBAEIAgBAAIAQACAEAQgCAEAAgBAAIAQBCAIAQACAEAAgBAEIAgBAAIAQACAEAQgCAEAAgBAAIAQBCAIAQACAEAAgBAEIA"
            + "gBAAIAQACAEAQgCAEAAgBAAIAQBCAIAQACAEAAgBAEIAgBAAIAQACAEAQgCAEAAgBAAIAQBCAIAQACAEAAgBAEIAgBAAIAQACAEAQgCAEAAIgRAACIEQAAiBEAAIgRAACIEQAAiBEAAIgRAACIEQAAiBEAAIgRAACIEXAQgBAEIAgBAAIAQACAEAQgCAEAAgBAAIAQBCAI"
            + "AQACAEAAgBAEIAgBAAIAQACAEAm0JgZmZZEwIzMyHwBDMzITAzs9gNCKTd1bzKWBgAAAAASUVORK5CYII=";


    /**
     * GDCA-签署结果
     */
    public static final String GDCA_SIGNED_STATUS_OK = "1";

    // 是否标识
    public static final Integer STATUS_YES = 1;
    public static final Integer STATUS_NO = 0;
    // 显示指数类型标识Commission
    public static final Integer SHOW_COMMISSION_HIDE = 0;// 不显示
    public static final Integer SHOW_COMMISSION_INDEX = 1;// 显示小七指数
    public static final Integer SHOW_COMMISSION_POINT = 2;// 显示市场积分

    /**
     * 用法用量相关常量
     */
    public static final String CYCLE_UNIT_TWO_DAY = "隔日";
    public static final String CYCLE_PREFIX = "每";
    public static final String CYCLE_UNIT_DAY = "日";
    public static final String CYCLE_UNIT_HOUR = "小时";
    public static final String DOSAGE_COUNT_SUFFIX = "次";

    /**
     * 附加启事消息显示位置(相对主体消息)
     */
    public static final Integer ADDITIONAL_NOTICE_DISPLAY_POSITION_B = 1;// 前
    public static final Integer ADDITIONAL_NOTICE_DISPLAY_POSITION_A = 2;// 后
    /**
     * 处方详情页是否显示作废按钮：0 显示， 1 不显示
     */
    public static final Integer SHOW_INVALID_BTN_YES = 0;
    public static final Integer SHOW_INVALID_BTN_NO = 1;

    /**
     * 推荐购买状态
     */
    public static final int RECOM_STATUS_ADDED_NOT_BUY = 2; // 购买状态-已下单未回调

    public static final String RECOM_DRUG_REMIND_CALLBACK = "recom.drug.remind.callback";
    public static final String REVISIT_REMIND_DAY = "recom.revisit.doctor.day";
    public static final String REVISIT_REMIND_BEGIN_DAY = "recom.revisit.patient.begin.day";
    public static final String REVISIT_REMIND_END_DAY = "recom.revisit.patient.end.day";
    public static final String REVISIT_REMIND_LIST_DAY = "recom.revisit.doctor.list.day";

    public enum RecomStatusEunm {
        NOT_BUY(0, "未购买"),
        ALREADY_BUY(1, "已购买"),
        ALREADY_ORDER(2, "已下单"),
        PART_BUY(3, "少购买"),
        ALREADY_CANCEL(4, "已取消"),
        ALREADY_INVALID(5, "已作废处方");
        private int code;
        private String info;

        RecomStatusEunm(int code, String info) {
            this.code = code;
            this.info = info;
        }

        public int getCode() {
            return this.code;
        }

        public String getInfo() {
            return this.info;
        }


        public static RecomStatusEunm valuesOf(int statusCode) {
            RecomStatusEunm[] totalEnums = RecomStatusEunm.class.getEnumConstants();
            for (RecomStatusEunm tempEnum : totalEnums) {
                if (tempEnum.getCode() == statusCode) {
                    return tempEnum;
                }
            }
            return null;
        }
    }

    /**
     * 患者被冻结缓存key
     */
    public static final String CACHE_KEY_DIS_PATIENT = "naiterui-pt|dis_patient_";

    /**
     * 医生信息快照缓存 ：<code>CACHT_KEY_INFO_DOCTOR</code>
     */
    public static final String CACHT_KEY_INFO_DOCTOR = "naiteruipatiert|disdoctor.";

    /**
     * 医生账户状态key：<code>DOCTOR_STATUS_KEY</code>
     */
    public static final String DOCTOR_STATUS_KEY = "status";

    /**
     * 医生少购买提醒信息
     */
    public static final String RECOM_DETAIL_NOT_BUY_INFO = "患者未购买该药品";
    public static final String RECOM_DETAIL_PART_BUY_INFO = "患者已购买%d件,未购买%d件";

    /**
     * 购买药品到期提醒文案
     */
    public static final String MEDICATION_EXPIRE_INFO = "%s将服用完";
    // 到期提醒日期格式化
    public static final String EXPIRE_DATE_FORMAT = "M月d日";

    /**
     * 提醒备案禁止推送处方状态
     */
    public static final int FORBIDEN_STATUS_NO = 1;// 允许
    public static final int FORBIDEN_STATUS_YES = 2;// 禁止
    public static final int FORBIDEN_STATUS_NULL = 0;// 未设置-历史数据

    /**
     * 复购提醒记录发送状态
     */
    public static final int REBUY_NOTICE_STATUS_SEND = 1;// 已发送
    public static final int REBUY_NOTICE_STATUS_UNSEND = 0;// 未发送

    /**
     * 安全用药缓存key
     */
    public static final String CACHE_KEY_SAFE_CHECK = "recommend-server|safe_check_";
    public static final String CACHE_KEY_SAFE_CHECK_STATUS = "recommend-server|safe_check_status";//惠每开关状态
    public static final String CACHE_KEY_SAFE_DOSAGE_STATUS = "recommend-server|safe_dosage_status";//安全用量开关状态

    /**
     * 复诊提醒最小用法用量
     */
    public static final Double VALID_MIN_DRUG_CYCLE = 3d;
    /**
     * 推荐用药可生成提醒预置用法用量
     */
    public static final String RECOM_DRUG_REMIND = "recom.drug.remind";
    public static final String RECOM_DRUG_REMIND_ITEM = "recom.drug.remind.item";
    public static final int RECOM_DRUG_REMIND_START = 8;
    public static final int RECOM_DRUG_REMIND_END = 20;

    public static final String TASK_SCHEDULE_HOST = "schedule.host.url";

    /**
     * 医生发送处方系统提醒
     */
    public static final int MESSAGE_TYPE_PATIENTS_PRESCRIPTION = 10009;

}
